#include "TesPch.h"
#include "TesProgramParser.h"
#include "TesBlockParser.h"


TesProgramParser::TesProgramParser( const TesConfig & config, TesTokenStream & tokens )
: TesParserBase( config, tokens )
{
}


bool TesProgramParser::Parse()
{
	TesBlockParser blockParser( this->GetConfig(), this->GetTokens() );
	if( blockParser.Parse() == false )
	{
		return false;
	}

	const TesBlockCode * block = blockParser.GetBlock();
	mProgram = new TesProgramCode( this->GetTokens().GetCurrentLocation(), block );
	return true;
}